import time
from rich.console import Console
from rich.progress import Progress

console = Console()

with Progress() as progress:
    # 1. 下载进度
    download_task = progress.add_task("[red]Downloading...", total=100)
    while not progress.finished:
        progress.update(download_task, advance=20)
        time.sleep(1)
        
    # 2.安装进度
    install_task = progress.add_task("[green]Installing...", total=100)
    while not progress.finished:
        progress.update(install_task, advance=10)
        time.sleep(1)